package zoran.wang.utils;

import java.util.Arrays;

/**
 * description：日志工具类
 *
 * @author wangzhuo
 * @date 2022/3/19 19:10
 * @Email zoranwang@yeah.net
 */
public class LogUtils {

    /**
     * 执行前
     *
     * @param method
     * @param args
     */
    public static void logBefore(String method, Object... args) {
        System.out.println("当前运算为" + method + "，参数是" + Arrays.asList(args));
    }

    /**
     * 返回时
     *
     * @param method
     * @param result
     */
    public static void logAfterReturning(String method, Object result) {
        System.out.println("当前运算为" + method + "，结果是" + Arrays.asList(result));
    }

    /**
     * 抛出异常时
     *
     * @param method
     * @param e
     */
    public static void logAfterThrowing(String method, Exception e) {
        System.out.println("当前运算为" + method + "，异常是" + Arrays.asList(e));
    }

}
